# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=3

inherit thexgames

DESCRIPTION="The X-Tended Mod is a modification for the game X3: Reunion by Egosoft"
HOMEPAGE="http://www.thexuniverse.com/content/117-The-X-Tended-Mod"
SRC_URI="http://downloads.thexuniverse.us/downloads/XTM_${PV}_Full.exe
	linguas_ru? ( http://thexgames.googlecode.com/files/xtm075_eg_autor_strannik_al_211.rar )"

LICENSE="as-is"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE=""

LANGS="ru"
for L in ${LANGS}; do
	IUSE="${IUSE} linguas_${L}"
done

RDEPEND="!games-misc/x3-mod-fps-turbomod2
		!games-misc/x3-mod-emp"
DEPEND="app-arch/unrar
	${RDEPEND}"

S=${WORKDIR}

src_unpack() {
	ln -s ${DISTDIR}/XTM_${PV}_Full.exe ${PN}.7z
	unpack ./${PN}.7z
	rm ${PN}.7z

	use linguas_ru && unrar x -o+ ${DISTDIR}/xtm075_eg_autor_strannik_al_211.rar t/
}
